import RichTextEditor from "@/component/common/richText";


export interface EssayProps {
  data?: string;
  state: 'QUESTYPE' | 'WRITE' | 'READ' | 'PREVIEW' | 'TODO'
  onChange?: (data: any) => void;
}
export default function Essay(props: EssayProps) {
  let { data = "", state = "QUESTYPE",  onChange = () => { } } = props;
  if (state === "QUESTYPE") {
    data = "";
  }

  
  return (
    <div style={{ width: "50%" }}>
      <RichTextEditor content={data} state={state} onChange={(data) => {
        onChange(data);
      }}></RichTextEditor>
    </div>
  );
}
